import Vue from 'vue'
import Vuex from 'vuex'
import {getAddress} from "../api/index"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    addressData:[]
  },
  mutations: {
    SET_ADDRESSDATA(state,data){
      state.addressData=data
    }
  },
  actions: {
    getAddress(context,data){
      getAddress(data).then(res=>{
        context.commit('SET_ADDRESSDATA',res.data.data)
      })
    }
  },
  modules: {
  }
})
